<!--自定义的描述列表-->
<template>
  <n-descriptions label-placement="left" class="py-2" :column="props.column" bordered  label-align="left" size="small">
    <n-descriptions-item v-for="(item,index) in xinxiList">
      <template #label>
        <div class="min-w-100px">{{item.label}}</div>
      </template>
      <slot v-if="item.slot" :name="item.slot" :value="item" :index="index"></slot>
      <p v-else class="min-w-100px">{{item.value || props.kong}}</p>
    </n-descriptions-item>
  </n-descriptions>
</template>

<script setup>
import {useRoute, useRouter} from "vue-router";

const router = useRouter()
const route = useRoute()
const props = defineProps({
  infoList:{
    type:Array,
    default: [],
  },
  kong:{
    type:String,
    default:"---",
  },
  // 描述列表的列数，默认是1列
  column:{
    type:Number,
    default:1,
    validator(value) {
      return value >= 1
    },
  },
})

const xinxiList = computed(()=>{
  return props.infoList.filter(item=>!item.hidden)
})
</script>

<style scoped>

</style>
